export const getAppVersion = () => uni.$u.http.get('/auth/appVersion')

export const login = (params) => uni.$u.http.post('/auth/login', params)

export const getInfo = () => uni.$u.http.get('/system/user/profile');

export const logout = () => uni.$u.http.post('/auth/logout')

export const getDictDataByType = (dictType) => uni.$u.http.get(`/system/dict/data/type/${dictType}`)

export const sendCode = (params) => uni.$u.http.get('/resource/sms/code', params)

// 用户注册接口
export const register = (params) => uni.$u.http.post('/auth/register', params)

// 发送短信验证码
export const sendSmsCode = (params) => uni.$u.http.get('/resource/sms/code', params)

//获取问卷列表
export const getQuestionaireList = (params) => uni.$u.http.get('/stroke/questionaire/list', params)

//问卷所有信息
export const getQuestionaireAllDetail = (id) => uni.$u.http.get(`/stroke/questionaire/querryAll/${id}`) 

//问卷名 
export const getQuestionaire = (id) => uni.$u.http.get(`/stroke/questionaire/${id}`)

//问卷题目
export const getQuestionaireQuestion = (params) => uni.$u.http.get('/stroke/questionaireQuestion/list',{params})

//问卷选项
export const getQuestionaireSelect = (params) => uni.$u.http.get('/stroke/questionaireSelect/list',{params})

// 提交答案
export const submitAnswers = (data) => uni.$u.http.post('/stroke/questionaireAnswer/app', data)

// 提交意见反馈
export const submitFeedback = (data) => uni.$u.http.post('/stroke/feedback', data)

//获取问卷id对应的log记录列表
export const getQuestionaireLogIdList = (id) => uni.$u.http.get(`/stroke/questionaireLog/idList/${id}`)

//获取stroke用户信息
export const getStrokeUserInfo = () => uni.$u.http.get('/stroke/strokeUser/info')

//修改用户信息与疾病列表
export const updateUserInfo = (data) => uni.$u.http.put('/stroke/strokeUser', data)

//获取用户健康指标
export const getUserIndicatorInfo = () => uni.$u.http.get('/stroke/indicator/detail/info')

//查询用户健康指标列表
export const getUserIndicatorList = (id) => uni.$u.http.get('/stroke/indicator/listByUserId')

//新建用户健康指标，得到指标id 用户首次使用
export const addUserIndicatorInfo = (data) => uni.$u.http.post('/stroke/indicator/add', data)

//修改健康指标
export const updateUserIndictor = (data) => uni.$u.http.put('/stroke/indicator/appUpdate', data)

//返回指导视频列表
export const getGuidanceVideoList = (params) => uni.$u.http.get('/stroke/guidance/list', params)

//根据id查询对应的视频列表Z
export const getGuidanceVideoById = (id) => uni.$u.http.get(`/stroke/guidance/${id}`)

//新增视频播放历史
export const addVideoHistory = (data) => uni.$u.http.post('/stroke/guidanceHistory', data)

//更新视频播放历史
export const updateVideoHistory = (data) => uni.$u.http.put('/stroke/guidanceHistory', data)

//查看当前视频播放记录
export const getVideoHistoryById = (params) => uni.$u.http.get('/stroke/guidanceHistory/list', params)

//提交qr问卷答案
export const submitQrAnswer = (data) => uni.$u.http.post('/stroke/qrAnswer/appInsert', data)

//查询qr问卷结果列表
export const getQrResultList = () => uni.$u.http.get('/stroke/qrResult/appList')

//用qr结果id查询详细信息
export const getQrResultDetail = (id) => uni.$u.http.get(`/stroke/qrResult/${id}`)


export const removeFile = (ossIds) => uni.$u.http.delete(`/resource/oss/${ossIds}`)

export const getFileList = (ossIds) => uni.$u.http.get(`/resource/oss/listByIds/${ossIds}`)


export const getFileById = (id) => uni.$u.http.get(`/resource/oss/listByIds/${id}`)

export const previewFile = (id) => uni.$u.http.get(`/resource/oss/preview/${id}`)


//聊天室
export const getDoctorList = (roleName) => uni.$u.http.get(`/stroke/strokeUser/consulation/${roleName}`)